package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Arrays;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GrainsituationRecordMapper;
import com.ruoyi.system.domain.GrainsituationRecord;
import com.ruoyi.system.service.IGrainsituationRecordService;

/**
 * 粮情主Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-03
 */
@Service
public class GrainsituationRecordServiceImpl extends ServiceImpl<GrainsituationRecordMapper,GrainsituationRecord> implements IGrainsituationRecordService
{
    @Autowired
    private GrainsituationRecordMapper grainsituationRecordMapper;

    /**
     * 查询粮情主
     * 
     * @param id 粮情主主键
     * @return 粮情主
     */
    @Override
    public GrainsituationRecord selectGrainsituationRecordById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询粮情主列表
     * 
     * @param grainsituationRecord 粮情主
     * @return 粮情主
     */
    @Override
    public List<GrainsituationRecord> selectGrainsituationRecordList(GrainsituationRecord grainsituationRecord)
    {
        return grainsituationRecordMapper.selectGrainsituationRecordList(grainsituationRecord);
    }

    /**
     * 新增粮情主
     * 
     * @param grainsituationRecord 粮情主
     * @return 结果
     */
    @Override
    public boolean insertGrainsituationRecord(GrainsituationRecord grainsituationRecord)
    {
        return this.save(grainsituationRecord);
    }

    /**
     * 修改粮情主
     * 
     * @param grainsituationRecord 粮情主
     * @return 结果
     */
    @Override
    public boolean updateGrainsituationRecord(GrainsituationRecord grainsituationRecord)
    {
        return this.updateById(grainsituationRecord);
    }

    /**
     * 批量删除粮情主
     * 
     * @param ids 需要删除的粮情主主键
     * @return 结果
     */
    @Override
    public boolean deleteGrainsituationRecordByIds(Long[] ids)
    {
        return super.removeByIds(Arrays.asList(ids));
    }

    /**
     * 删除粮情主信息
     * 
     * @param id 粮情主主键
     * @return 结果
     */
    @Override
    public boolean deleteGrainsituationRecordById(Long id)
    {
        return this.removeById(id);
    }
}
